public class test {
    public static void main(String[] args) {
        PetDog dog = new PetDog();
        dog.name = "大黄";
        dog.wag();
        dog.name = "大黑";
        dog.barks();
    }
}

class PetDog {
    public String name;//名字
    public String colo;//颜色
    //狗的属性
    public void barks() {
        System.out.println(name + ":汪汪汪~~~");
    }
    //狗的行为
    public void wag() {
        System.out.println(name + ":睡觉");
    }
}
